Integrand size = 24, antiderivative size = 74 \[ \int \cot ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=2 a^2 x+\frac {2 a^2 \cot (c+d x)}{d}-\frac {i a^2 \cot ^2(c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {2 i a^2 \log (\sin (c+d x))}{d} \]
[Out]
Time = 0.14 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3623, 3610, 3612, 3556} \[ \int \cot ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {i a^2 \cot ^2(c+d x)}{d}+\frac {2 a^2 \cot (c+d x)}{d}-\frac {2 i a^2 \log (\sin (c+d x))}{d}+2 a^2 x \]
[In]
[Out]
Rule 3556
Rule 3610
Rule 3612
Rule 3623
Rubi steps \begin{align*} \text {integral}& = -\frac {a^2 \cot ^3(c+d x)}{3 d}+\int \cot ^3(c+d x) \left (2 i a^2-2 a^2 \tan (c+d x)\right ) \, dx \\ & = -\frac {i a^2 \cot ^2(c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}+\int \cot ^2(c+d x) \left (-2 a^2-2 i a^2 \tan (c+d x)\right ) \, dx \\ & = \frac {2 a^2 \cot (c+d x)}{d}-\frac {i a^2 \cot ^2(c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}+\int \cot (c+d x) \left (-2 i a^2+2 a^2 \tan (c+d x)\right ) \, dx \\ & = 2 a^2 x+\frac {2 a^2 \cot (c+d x)}{d}-\frac {i a^2 \cot ^2(c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\left (2 i a^2\right ) \int \cot (c+d x) \, dx \\ & = 2 a^2 x+\frac {2 a^2 \cot (c+d x)}{d}-\frac {i a^2 \cot ^2(c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {2 i a^2 \log (\sin (c+d x))}{d} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.50 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.42 \[ \int \cot ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {a^2 \cot ^3(c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},-\tan ^2(c+d x)\right )}{3 d}+\frac {a^2 \cot (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\tan ^2(c+d x)\right )}{d}-\frac {i a^2 \left (\cot ^2(c+d x)+2 \log (\cos (c+d x))+2 \log (\tan (c+d x))\right )}{d} \]
[In]
[Out]
Time = 0.51 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.85
method | result | size |
parallelrisch | \(-\frac {a^{2} \left (\cot ^{3}\left (d x +c \right )+3 i \left (\cot ^{2}\left (d x +c \right )\right )+6 i \ln \left (\tan \left (d x +c \right )\right )-3 i \ln \left (\sec ^{2}\left (d x +c \right )\right )-6 d x -6 \cot \left (d x +c \right )\right )}{3 d}\) | \(63\) |
derivativedivides | \(\frac {-a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )+2 i a^{2} \left (-\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )}{d}\) | \(78\) |
default | \(\frac {-a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )+2 i a^{2} \left (-\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )}{d}\) | \(78\) |
risch | \(-\frac {4 a^{2} c}{d}+\frac {2 i a^{2} \left (15 \,{\mathrm e}^{4 i \left (d x +c \right )}-18 \,{\mathrm e}^{2 i \left (d x +c \right )}+7\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}-\frac {2 i a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) | \(78\) |
norman | \(\frac {-\frac {a^{2}}{3 d}+2 a^{2} x \left (\tan ^{3}\left (d x +c \right )\right )+\frac {2 a^{2} \left (\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {i a^{2} \tan \left (d x +c \right )}{d}}{\tan \left (d x +c \right )^{3}}+\frac {i a^{2} \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {2 i a^{2} \ln \left (\tan \left (d x +c \right )\right )}{d}\) | \(101\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 139 vs. \(2 (68) = 136\).
Time = 0.24 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.88 \[ \int \cot ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {2 \, {\left (-15 i \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} + 18 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - 7 i \, a^{2} + 3 \, {\left (i \, a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} - 3 i \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} + 3 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{2}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )\right )}}{3 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} - 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 136 vs. \(2 (66) = 132\).
Time = 0.21 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.84 \[ \int \cot ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=- \frac {2 i a^{2} \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} + \frac {30 i a^{2} e^{4 i c} e^{4 i d x} - 36 i a^{2} e^{2 i c} e^{2 i d x} + 14 i a^{2}}{3 d e^{6 i c} e^{6 i d x} - 9 d e^{4 i c} e^{4 i d x} + 9 d e^{2 i c} e^{2 i d x} - 3 d} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.12 \[ \int \cot ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {6 \, {\left (d x + c\right )} a^{2} + 3 i \, a^{2} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 6 i \, a^{2} \log \left (\tan \left (d x + c\right )\right ) + \frac {6 \, a^{2} \tan \left (d x + c\right )^{2} - 3 i \, a^{2} \tan \left (d x + c\right ) - a^{2}}{\tan \left (d x + c\right )^{3}}}{3 \, d} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 146 vs. \(2 (68) = 136\).
Time = 0.81 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.97 \[ \int \cot ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 i \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 96 i \, a^{2} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) - 48 i \, a^{2} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - 27 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {-88 i \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 27 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 6 i \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
[In]
[Out]
Time = 4.26 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.92 \[ \int \cot ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {2\,a^2\,\mathrm {cot}\left (c+d\,x\right )}{d}+\frac {4\,a^2\,\mathrm {atan}\left (2\,\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{d}-\frac {a^2\,{\mathrm {cot}\left (c+d\,x\right )}^3}{3\,d}-\frac {a^2\,{\mathrm {cot}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{d} \]
[In]
[Out]